<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#" >手术预约列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                                <form:form id="searchForm" modelAttribute="operationApply"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/operation/operationSchedule/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                </form:form>
                            </div>
                        </div>
                        <table  class="table table-bordered table-striped mg-t datatable">
                            <thead>
                            <tr>
                                <th>病人名字</th>
                                <th>手术日期及时间</th>
                                <th>手术室</th>
                                <th>手术间</th>
                                <th>门诊/住院</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${applyPage.list}" var="operationApply">
                            <tr>
                                <td align="center">${operationApply.patientName}</td>
                                <td align="center"> <fmt:formatDate value="${operationApply.scheduledDate}"
                                                     pattern="yyyy-MM-dd HH:mm:ss" var="date"/>${date}</td>
                                <td align="center"> ${operationApply.operatingRoomName}</td>
                                <td align="center"> ${operationApply.operatingNoName}</td>
                                <td align="center">
                                    <c:if test="${operationApply.inoroutFlag=='0'}">门诊</c:if>
                                    <c:if test="${operationApply.inoroutFlag=='1'}">住院</c:if>
                                </td>
                                <td align="center">
                                    <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationSchedule/formApply?id=${operationApply.id}')" class="btn btn-success btn-xs">安排</a>
                                </td>
                            </tr>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#" >手术安排列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                                <form:form id="searchForm" modelAttribute="operationSchedule"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/operation/operationSchedule/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                </form:form>
                            </div>
                        </div>
                        <table  class="table table-bordered table-striped mg-t datatable">
                            <thead>
                            <tr>
                                <th>病人名字</th>
                                <th>手术日期及时间</th>
                                <th>手术室</th>
                                <th>手术间</th>
                                <th>门诊/住院</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${schedulePage.list}" var="operationSchedule">
                            <tr>
                                <td align="center">${operationSchedule.patientName}</td>
                                <td align="center"><fmt:formatDate value="${operationSchedule.scheduledDate}"
                                                      pattern="yyyy-MM-dd HH:mm:ss" var="date"/>${date}</td>
                                <td align="center"> ${operationSchedule.operatingRoomName}</td>
                                <td align="center"> ${operationSchedule.operatingNoName}</td>
                                <td align="center">
                                    <c:if test="${operationSchedule.inoroutFlag=='0'}">门诊</c:if>
                                    <c:if test="${operationSchedule.inoroutFlag=='1'}">住院</c:if>
                                </td>
                                <td align="center">
                                    <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationSchedule/formSchedule?id=${operationSchedule.id}')" class="btn btn-success btn-xs">修改</a>
                                    <a href="#"  class="applyBt btn btn-danger btn-xs" onclick="confirmExtend('确认要删除该吗？',function(){delLoad('mainCenterDiv','${ctx}/operation/operationSchedule/delete?id=${operationSchedule.id}','${ctx}/operation/operationSchedule/index')})">删除</a>
                                </td>
                            </tr>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                        <%--新增按钮暂时注释掉，因为没有选病人的功能，没法开展--%>
                        <%--<c:set value="1" var="state"/>
                        <input class="btn btn-primary" type="button" value="新增" onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationSchedule/formSchedule?operStatus=${state}')"/>--%>
                    </div>
                </div>
            </section>
        </div>
    </div>